package com.example.zy5_project_jetpack.mvp.presenter;

import com.example.zy5_project_jetpack.mvp.model.CallBackData;
import com.example.zy5_project_jetpack.mvp.model.ModelData;
import com.example.zy5_project_jetpack.mvp.view.Bean.HomeBean;
import com.example.zy5_project_jetpack.mvp.view.Fragment.HomeFragment;

import java.util.List;

public class PresenterData {
    private HomeFragment homeFragment;
    private final ModelData modelData;
//zxcvbnmhah
    public PresenterData(HomeFragment homeFragment) {

        this.homeFragment = homeFragment;
        modelData = new ModelData();
    }

    public void startData() {
        modelData.requestData(new CallBackData() {
            @Override
            public void onSuccessData(List<HomeBean.DataBeanX.DataBean> object) {
                homeFragment.getSuccessData(object);
            }

            @Override
            public void onError(String str) {
                homeFragment.getError(str);
            }
        });
    }
}
